﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JiaBao.Services.AuctionService
{
    public class AuctionService : IAuctionService
    {
        public DataTable GetAll()
        {
            try
            {
                return SqlHelper.ExecuteDataTable("select 拍卖会名称,拍卖会ID from Auctionall where 拍卖会Id>0 order by 拍卖会Id desc");

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }

        public DataTable GetByAucId(int aucid)
        {
            try
            {
                return SqlHelper.ExecuteDataTable("select 拍卖会名称,拍卖会ID from Auctionall where 拍卖会ID = @Id", new SqlParameter("Id", aucid));

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
    }
}
